import request from '@/config/axios'
import type { Hotel } from './types'

export const getHotelListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/hotels', params })
}

export const createHotelApi = (data: Partial<Hotel>): Promise<IResponse> => {
  return request.post({ url: '/hotels', data })
}

export const updateHotelApi = (id: string, data: Partial<Hotel>): Promise<IResponse> => {
  return request.put({ url: `/hotels/id/${id}`, data })
}

export const getHotelDetailApi = (id: string): Promise<IResponse<Hotel>> => {
  return request.get({ url: `/hotels/id/${id}` })
}

export const delHotelListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/hotels/id/${ids[0]}` })
}
